<!-- application/views/scripts/filesystem/index.phtml -->

<?php $this->headLink()->appendStylesheet($this->baseUrl('/css/outputs/style.css')); ?>
<?php $this->headScript()->appendFile($this->baseUrl("/js/outputs/index.js")); ?>
<?php $this->headTitle()->prepend(X_Env::_('p_outputs_title')); ?>


<div class="span-24 last" id="back-to-home">
	<div class="span-4 box back">
		<a href="<?php echo $this->url(array('controller' => 'manage', 'action' => 'index'), 'default', true); ?>"><?php echo X_Env::_('back_to_home'); ?></a>
	</div>
	<div class="span-18 box title last">
		<h4><?php echo X_Env::_('p_outputs_title'); ?></h4>
	</div>
</div>


<?php if ( count($this->messages) ) :?>
<div class="span-24 last" id="manage-messages">
	<ul>
		<?php foreach ($this->messages as $i => $message ): ?>
			<?php if ( !is_array($message) ) $message = array('text' => $message, 'type' => 'warning'); ?>
			<li class="<?php echo @$message['type']?>">
				<img src="<?php echo @$this->baseUrl("/images/msg_{$message['type']}.png");?>" alt="<?php echo @$message['type']; ?>" />
				<?php echo $message['text']?>
			</li>
		<?php endforeach; ?>
	</ul>
</div>
<?php endif; ?>

<div class="quickactionbox">
	<button class="quickbox-add"><?php echo X_Env::_('p_outputs_output_new'); ?></button>
</div>

<h2><?php echo X_Env::_('p_outputs_general_title'); ?></h2>
<div class="span-24 last boxes" id="devices-null">
	<div class="span-24 last">
		<div class="span-6"><h4><?php echo X_Env::_('p_outputs_header_label'); ?></h4></div>
		<div class="span-6"><h4><?php echo X_Env::_('p_outputs_header_link'); ?></h4></div>
		<div class="span-7"><h4><?php echo X_Env::_('p_outputs_header_args'); ?></h4></div>
		<div class="span-1 last"><h4><?php echo X_Env::_('p_outputs_header_priority'); ?></h4></div>
	</div>
	<?php foreach ( $this->generalOuts as $i => $out): ?>
		<?php /* @var $out Application_Model_Output */?>
		<div class="span-24 last sharebox" id="outputId-<?php echo $out->getId();?>">
			<div class="span-6 share">
				<span class="label">
					<?php echo $out->getLabel() ?>
				</span>
			</div>
			<div class="span-17 subboxright">
				<div class="boxitem-rowicon ui-state-default" title="<?php echo X_Env::_('remove'); ?>">
					<span class="ui-icon ui-icon-trash"><?php echo X_Env::_('remove'); ?></span>
				</div>
				<div class="boxitem-rowicon ui-state-default" title="<?php echo X_Env::_('edit'); ?>">
					<span class="ui-icon ui-icon-pencil"><?php echo X_Env::_('edit'); ?></span>
				</div>
				<div class="span-15 cell">
					<div class="span-6 link" title="<?php echo $out->getLink(); ?>">
						<?php echo (strlen($out->getLink()) > 35 ? substr($out->getLink(), 0, 31).'...' : $out->getLink()); ?>
					</div>
					<div class="span-7 arg" title="<?php echo $out->getArg(); ?>">
						<?php echo (strlen($out->getArg()) > 45 ? substr($out->getArg(), 0, 41).'...' : $out->getArg()); ?>
					</div>
					<div class="span-1">
						<input type="text" size="3" class="priority" disabled="disabled" style="margin: 0px; padding: 0px" value="<?php echo $out->getWeight()?>" />
					</div>
				</div>
			</div>
		</div>
	<?php endforeach; ?>
</div>

<?php if ( count($this->wiimcOuts)) : ?>
	<hr class="space"/>
	<h2><?php echo X_Env::_('p_outputs_wiimc_title'); ?></h2>
	<div class="span-24 last boxes" id="devices-<?php echo X_VlcShares_Plugins_Helper_Devices::DEVICE_WIIMC?>">
		<div class="span-24 last">
			<div class="span-6"><h4><?php echo X_Env::_('p_outputs_header_label'); ?></h4></div>
			<div class="span-6"><h4><?php echo X_Env::_('p_outputs_header_link'); ?></h4></div>
			<div class="span-7"><h4><?php echo X_Env::_('p_outputs_header_args'); ?></h4></div>
			<div class="span-1 last"><h4><?php echo X_Env::_('p_outputs_header_priority'); ?></h4></div>
		</div>
		<?php foreach ( $this->wiimcOuts as $i => $out): ?>
			<?php /* @var $out Application_Model_Output */?>
			<div class="span-24 last sharebox" id="outputId-<?php echo $out->getId();?>">
				<div class="span-6 share">
					<span class="label">
						<?php echo $out->getLabel() ?>
					</span>
				</div>
				<div class="span-17 subboxright">
					<div class="boxitem-rowicon ui-state-default" title="<?php echo X_Env::_('remove'); ?>">
						<span class="ui-icon ui-icon-trash"><?php echo X_Env::_('remove'); ?></span>
					</div>
					<div class="boxitem-rowicon ui-state-default" title="<?php echo X_Env::_('edit'); ?>">
						<span class="ui-icon ui-icon-pencil"><?php echo X_Env::_('edit'); ?></span>
					</div>
					<div class="span-15 cell">
						<div class="span-6 link" title="<?php echo $out->getLink(); ?>">
							<?php echo (strlen($out->getLink()) > 35 ? substr($out->getLink(), 0, 31).'...' : $out->getLink()); ?>
						</div>
						<div class="span-7 arg" title="<?php echo $out->getArg(); ?>">
							<?php echo (strlen($out->getArg()) > 45 ? substr($out->getArg(), 0, 41).'...' : $out->getArg()); ?>
						</div>
						<div class="span-1">
							<input type="text" size="3" class="priority" disabled="disabled" style="margin: 0px; padding: 0px" value="<?php echo $out->getWeight()?>" />
						</div>
					</div>
				</div>
			</div>
		<?php endforeach; ?>
	</div>
<?php endif; ?>


<?php if ( count($this->androidOuts)) : ?>
	<hr class="space"/>
	<h2><?php echo X_Env::_('p_outputs_android_title'); ?></h2>
	<div class="span-24 last boxes" id="devices-<?php echo X_VlcShares_Plugins_Helper_Devices::DEVICE_ANDROID?>">
		<div class="span-24 last">
			<div class="span-6"><h4><?php echo X_Env::_('p_outputs_header_label'); ?></h4></div>
			<div class="span-6"><h4><?php echo X_Env::_('p_outputs_header_link'); ?></h4></div>
			<div class="span-7"><h4><?php echo X_Env::_('p_outputs_header_args'); ?></h4></div>
			<div class="span-1 last"><h4><?php echo X_Env::_('p_outputs_header_priority'); ?></h4></div>
		</div>
		<?php foreach ( $this->androidOuts as $i => $out): ?>
			<?php /* @var $out Application_Model_Output */?>
			<div class="span-24 last sharebox" id="outputId-<?php echo $out->getId();?>">
				<div class="span-6 share">
					<span class="label">
						<?php echo $out->getLabel() ?>
					</span>
				</div>
				<div class="span-17 subboxright">
					<div class="boxitem-rowicon ui-state-default" title="<?php echo X_Env::_('remove'); ?>">
						<span class="ui-icon ui-icon-trash"><?php echo X_Env::_('remove'); ?></span>
					</div>
					<div class="boxitem-rowicon ui-state-default" title="<?php echo X_Env::_('edit'); ?>">
						<span class="ui-icon ui-icon-pencil"><?php echo X_Env::_('edit'); ?></span>
					</div>
					<div class="span-15 cell">
						<div class="span-6 link" title="<?php echo $out->getLink(); ?>">
							<?php echo (strlen($out->getLink()) > 35 ? substr($out->getLink(), 0, 31).'...' : $out->getLink()); ?>
						</div>
						<div class="span-7 arg" title="<?php echo $out->getArg(); ?>">
							<?php echo (strlen($out->getArg()) > 45 ? substr($out->getArg(), 0, 41).'...' : $out->getArg()); ?>
						</div>
						<div class="span-1">
							<input type="text" size="3" class="priority" disabled="disabled" style="margin: 0px; padding: 0px" value="<?php echo $out->getWeight()?>" />
						</div>
					</div>
				</div>
			</div>
		<?php endforeach; ?>
	</div>
<?php endif; ?>


<?php if ( count($this->pcOuts)) : ?>
	<hr class="space"/>
	<h2><?php echo X_Env::_('p_outputs_pc_title'); ?></h2>
	<div class="span-24 last boxes" id="devices-<?php echo X_VlcShares_Plugins_Helper_Devices::DEVICE_PC?>">
		<div class="span-24 last">
			<div class="span-6"><h4><?php echo X_Env::_('p_outputs_header_label'); ?></h4></div>
			<div class="span-6"><h4><?php echo X_Env::_('p_outputs_header_link'); ?></h4></div>
			<div class="span-7"><h4><?php echo X_Env::_('p_outputs_header_args'); ?></h4></div>
			<div class="span-1 last"><h4><?php echo X_Env::_('p_outputs_header_priority'); ?></h4></div>
		</div>
		<?php foreach ( $this->pcOuts as $i => $out): ?>
			<?php /* @var $out Application_Model_Output */?>
			<div class="span-24 last sharebox" id="outputId-<?php echo $out->getId();?>">
				<div class="span-6 share">
					<span class="label">
						<?php echo $out->getLabel() ?>
					</span>
				</div>
				<div class="span-17 subboxright">
					<div class="boxitem-rowicon ui-state-default" title="<?php echo X_Env::_('remove'); ?>">
						<span class="ui-icon ui-icon-trash"><?php echo X_Env::_('remove'); ?></span>
					</div>
					<div class="boxitem-rowicon ui-state-default" title="<?php echo X_Env::_('edit'); ?>">
						<span class="ui-icon ui-icon-pencil"><?php echo X_Env::_('edit'); ?></span>
					</div>
					<div class="span-15 cell">
						<div class="span-6 link" title="<?php echo $out->getLink(); ?>">
							<?php echo (strlen($out->getLink()) > 35 ? substr($out->getLink(), 0, 31).'...' : $out->getLink()); ?>
						</div>
						<div class="span-7 arg" title="<?php echo $out->getArg(); ?>">
							<?php echo (strlen($out->getArg()) > 45 ? substr($out->getArg(), 0, 41).'...' : $out->getArg()); ?>
						</div>
						<div class="span-1">
							<input type="text" size="3" class="priority" disabled="disabled" style="margin: 0px; padding: 0px" value="<?php echo $out->getWeight()?>" />
						</div>
					</div>
				</div>
			</div>
		<?php endforeach; ?>
	</div>
<?php endif; ?>



<div id="formbox" class="span-10 last hidden box" style="display: none; position: absolute; z-index: 100;">
	<h3><?php echo X_Env::_('p_outputs_newoutput_title'); ?></h3>
	<?php echo $this->form; ?>
</div>
